package app.htby.utils;

import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * 上下文获取工具类
 *
 */
public class SpringContextUtil {
	private static ConfigurableApplicationContext applicationContext;

	public static void setConfigurableApplicationContext(ConfigurableApplicationContext context) {
		applicationContext = context;
	}

	public static ApplicationContext getApplicationContext() {
		return applicationContext;
	}

	public static Object getBean(String beanId) {
		return applicationContext.getBean(beanId);
	}

}
